﻿using System.Web.Mvc;
using System.Data.Services;
using System.Web.Routing;
using AscentExplorer.Web.Areas.Top.Services;
using System.ServiceModel.Activation;
using System.Data.Entity;
using Microsoft.ApplicationServer.Http;
using Microsoft.ApplicationServer.Http.Activation;
using AscentTopLibrary;

namespace AscentExplorer.Web.Areas.Top
{
    public class TopAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Top";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            Database.SetInitializer<TopDbContext>(new DropCreateDatabaseIfModelChanges<TopDbContext>());

            context.MapRoute(
                "Top_default",
                "Top/{controller}/{action}/{id}",
                new { controller = "home", action = "Index", id = UrlParameter.Optional },
                new string[] {"AscentExplorer.Web.Areas.Top.Controllers"}
            );
        }
    }
}
